package base.util;

import demo.utils.DateUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author : GuoFei
 * @date : 2018/12/21 17:44
 */
@Component
public class Quartz {

    private static final Logger logger = LoggerFactory.getLogger(Quartz.class);

    public static void main(String[] args) {
        logger.info("nihao");
    }

    @Scheduled(cron="30 */1 * * * ?")
    public void run1(){
        System.out.println("注解式定时 每分钟30秒运行 run1 "+ DateUtil.getNow());
    }
    @Scheduled(cron="0 */1 * * * ?")
    public void run2(){
        System.out.println("注解式定时 run2 "+ DateUtil.getNow());
    }
    @Scheduled(cron="0 */1 * * * ?")
    public void run3(){
        System.out.println("注解式定时 run3 "+ DateUtil.getNow());
    }
}
